package com.createdevelopment.house.service.publicfacility;

import java.util.List;

import com.createdevelopment.house.dao.publicfacility.PublicFacilityDao;
import com.createdevelopment.house.entity.House;
import com.createdevelopment.house.entity.PublicFacility;

public class PublicFacilityServiceImpl implements PublicFacilityService {
	private PublicFacilityDao publicFacilityDao;

	public PublicFacilityDao getPublicFacilityDao() {
		return publicFacilityDao;
	}

	public void setPublicFacilityDao(PublicFacilityDao publicFacilityDao) {
		this.publicFacilityDao = publicFacilityDao;
	}

	@Override
	public void savePublicFacility(PublicFacility publicFacility) {
		// TODO Auto-generated method stub
		publicFacilityDao.savePublicFacility(publicFacility);
	}

	@Override
	public List<PublicFacility> obtainALLPublicFacilities() {
		// TODO Auto-generated method stub
		return publicFacilityDao.findALLPublicFacilities();
	}

	@Override
	public List<PublicFacility> findNotRelatedPublicFacilities(House house) {
		// TODO Auto-generated method stub
		List<PublicFacility> allPublicFacilities=publicFacilityDao.findALLPublicFacilities();
		List<PublicFacility> notRelatedPublicFacilities;
		allPublicFacilities.removeAll(house.getPublicFacilities());
		notRelatedPublicFacilities=allPublicFacilities;
		return notRelatedPublicFacilities;

	}

}
 